package org.wk.account.controller;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.wk.account.service.SubAccountService;
import org.wk.core.common.view.ResponseVo;
import org.wk.logger.common.annotation.SysLog;

import java.util.Map;

/**
 * @author TangShenShen
 * @Description:后台账户管理controller
 * @date 2018/6/4 11:35
 */
@RestController
@RequestMapping("/account/manage")
public class AccountMagController {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private SubAccountService accountService;

    /**
     * 账户管理的所选类型账户的变动记录
     * @author TangShenShen
     * @date 2018/5/29 11:48
     */
    @SysLog("子账户类型变动记录")
    @RequestMapping(value="/seq/list",method=RequestMethod.GET,produces=MediaType.APPLICATION_JSON_UTF8_VALUE)
    public ResponseVo getSubAccountSeqs(@RequestParam Map<String, Object> params){
        String accountType = (String) params.get("accountType");
        logger.info("账户管理变动列表>>>>{}  类型：",accountType);
        ResponseVo responseVo = accountService.selectSubAccountSeqs(accountType,params);
        logger.info("账户管理变动列表返回值>>>>{}",responseVo.toString());
        return responseVo;
    }

}
